package test.myTest;

import java.util.Scanner;

/**
 * @Description
 * @Author Firenut
 * @Date 2023-08-14 19:30
 */
public class test1 {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int[] nums = new int[10000];
        int count = 0;
        while (cin.hasNextInt()) {
            // Scanner cin = new Scanner(System.in);
            nums[count] = cin.nextInt();
            count++;

        }
        int[] dp = new int[count + 1];
        dp[0] = 0;
        dp[1] = nums[0];
        for (int i = 2; i <= count; i++) {
            dp[i] = Math.max(dp[i - 1], dp[i - 2] + nums[i - 1]);
        }
        System.out.println(dp[count]);
    }

}
